#include<stdio.h>
int main()
{
	int num,a,b,c;
	char ch;
    while(1){
		switch(scanf("%d%c%d=%d",&a,&ch,&b,&c)){
		case 4:if(a+b==c||a-b==c)
				   num++;
			break;
		case 3:getchar();
			break;
		case EOF:printf("%d\n",num);
			return 0;
		}

	}
    return 0;
}